home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEperParticleNew.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.0 KB  |  107 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    July 7, 1997
  21. //  Author:        sw
  22. //
  23. //  Procedure Name:
  24. //    AEperParticleNew
  25. //
  26. //  Description:
  27. //    Creates  attribute editor controls for perParticle Attributes 
  28. //
  29. //  Input Value:
  30. //    attributeUIName
  31. //     attributeType (vector, float)
  32. //    perParticleAttr (nodeName + attributeName)
  33. //
  34. //  Output Value:
  35. //    None
  36. //
  37.  
  38.  
  39. global proc AEperParticleNew ( string $attributeUIName,
  40.                 string $type,
  41.                 string $perParticleAttr )
  42. {
  43.     string $nodeName[];
  44.     tokenize($perParticleAttr, ".", $nodeName);
  45.     string $layoutName = ($nodeName[1] + "RowLayout");
  46.  
  47.     if (`attributeQuery -exists -node $nodeName[0] $nodeName[1]`) {
  48.         setUITemplate -pst attributeEditorPresetsTemplate;
  49.  
  50.         rowLayout -nc 4 -vis 0
  51.             -cat 1 right 5 
  52.             -cat 2 both 0
  53.             -cat 3 both 0
  54.             -cat 4 both 0 
  55.             $layoutName;
  56.             text -l $attributeUIName ;
  57.             button -l "Expr. Ed..."
  58.                 -c ( "particleExpressionEditor " + $perParticleAttr )
  59.                 ($nodeName[1] + "ExprEditButton");
  60.             button -l "Comp. Ed..."
  61.                 -c  "componentEditorWindow" 
  62.                 ($nodeName[1] + "CompEditButton");
  63.             button -l "Ramp..."
  64.                  -c ("ArrayMapperWnd "
  65.                     + $nodeName[0] + " "
  66.                     + $nodeName[1] )
  67.                 ($nodeName[1] + "RampButton");
  68.             setParent ..;
  69.         rowLayout -e -vis 1 $layoutName;
  70.         setUITemplate -ppt;
  71.     }
  72. }
  73.  
  74.  
  75.  
  76. global proc AEperParticleReplace ( string $attributeUIName,
  77.                     string $type,
  78.                     string $perParticleAttr )
  79. {
  80.     string $nodeName[];
  81.     tokenize($perParticleAttr, ".", $nodeName);
  82.     string $layoutName = ( $nodeName[1] + "RowLayout" );
  83.  
  84.     if (`attributeQuery -exists -node $nodeName[0] $nodeName[1]`) {
  85.         if (`rowLayout -exists $layoutName`) {
  86.             button -e -c ( "particleExpressionEditor " 
  87.                     + $perParticleAttr )
  88.                     ($nodeName[1] + "ExprEditButton");
  89.             button -e -c "componentEditorWindow" 
  90.                     ($nodeName[1] + "CompEditButton");
  91.             button -e -c ("ArrayMapperWnd " 
  92.                     + $nodeName[0] + " " 
  93.                     + $nodeName[1] )
  94.                     ($nodeName[1] + "RampButton");
  95.         } else {
  96.             AEperParticleNew $attributeUIName
  97.                     $type
  98.                     $perParticleAttr;
  99.         }
  100.     } else if (`rowLayout -exists $layoutName`){
  101.         rowLayout -e -vis 0 $layoutName; 
  102.         deleteUI -layout $layoutName;
  103.     }
  104. }
  105.  
  106.  
  107.